import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Params from '@/components/Params'

Vue.use(Router)

export default new Router({
  routes: [                 // 配置路由，这里是个数组
    {                       // 每一个链接都是一个对象
      path: '/',            // 链接路径
      name: 'Hello',        // 路由名称，
      component: HelloWorld
    },
    {
      path: '/params/:newsId/:newsTitle',
      component: Params
    },
    {
      path: '/gohome',
      redirect: '/'
    },
    {
      path: '/goParams/:newsId/:newsTitle',
      redirect: '/params/:newsId/:newsTitle'
    }
  ]
})
